package org.anachronos.jeep.agent.test.stub;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.xa.XAResource;

public class TransactionStub implements Transaction {
	private int status;
	
	public void commit() throws HeuristicMixedException,
			HeuristicRollbackException, RollbackException, SecurityException,
			SystemException {
		status = Status.STATUS_COMMITTED;
	}

	public boolean delistResource(XAResource arg0, int arg1)
			throws IllegalStateException, SystemException {
		return false;
	}

	public boolean enlistResource(XAResource arg0)
			throws IllegalStateException, RollbackException, SystemException {
		return false;
	}

	public int getStatus() throws SystemException {
		return status;
	}

	public void registerSynchronization(Synchronization arg0)
			throws IllegalStateException, RollbackException, SystemException {
	}

	public void rollback() throws IllegalStateException, SystemException {
		status = Status.STATUS_ROLLEDBACK;
	}

	public void setRollbackOnly() throws IllegalStateException, SystemException {
	}
}
